<header>
    <nav class="navbar navbar-default navbar-fixed-top">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">切换导航</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
                <a class="navbar-brand" href="/">后台管理系统</a> </div>
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{$admin.username} <span class="caret"></span></a>
                        <ul class="dropdown-menu dropdown-menu-left">
                            <!--<li><a title="查看或修改个人信息" data-toggle="modal" data-target="#seeUserInfo">个人信息</a></li>-->
                            <!--<li><a title="查看您的登录记录" data-toggle="modal" data-target="#seeUserLoginlog">登录记录</a></li>-->
                        </ul>
                    </li>
                    <li><a href="javascript:; " id="tuichulogin" >退出登录</a></li>
                </ul>
            </div>
        </div>
    </nav>
</header>
<script>
    $('#tuichulogin').click(function() {
        if(confirm('是否确认退出？')){
            $.ajax({
                type: "POST",
                url: "{:url('index/login/logout')}",
                data: {},
                cache: false, //不缓存此页面
                success: function (data) {
                    if (data == 1) {
                        self.location="{:url('index/login/index')}";
//                    history.go(0);
                    }
                }
            });
        }
    })
</script>